# from osgeo import gdalconst
# from osgeo import gdal
import numpy as np
import gdal
import gdalconst


def temp(raster_paths, vrt_path):
	""""""
	# os.environ['PROJ_LIB'] = r"/home/冯洋洋/PythonEnvironment/RasterShapeEnv/share/proj"
	options = gdal.BuildVRTOptions(
		resolution="highest",
		targetAlignedPixels=None,
		separate=True,
		# bandList=np.array([1] * len(raster_paths)),
		addAlpha=None,
		resampleAlg=gdalconst.GRA_NearestNeighbour,
		allowProjectionDifference=False,
		srcNodata=0,
		VRTNodata=0,
		hideNodata=True,
		callback=None,
		callback_data=None
	)
	gdal.BuildVRT(vrt_path, raster_paths, options=options)
	return


if __name__ == "__main__":
	raster_paths = [
		r"E:\Image2\S2A_MSIL1C_20220606T053651_N0400_R005_T43SFD_20220606T073214.SAFE\GRANULE\L1C_T43SFD_A036324_20220606T054156\IMG_DATA\T43SFD_20220606T053651_B08.jp2",
		r"E:\Image2\S2A_MSIL1C_20220606T053651_N0400_R005_T43SFD_20220606T073214.SAFE\GRANULE\L1C_T43SFD_A036324_20220606T054156\IMG_DATA\T43SFD_20220606T053651_B05.jp2",
		r"E:\Image2\S2A_MSIL1C_20220606T053651_N0400_R005_T43SFD_20220606T073214.SAFE\GRANULE\L1C_T43SFD_A036324_20220606T054156\IMG_DATA\T43SFD_20220606T053651_B04.jp2",
		]
	vrt_path = r"E:\Image2\test.vrt"
	temp(raster_paths, vrt_path)
